package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author cy
 * @since 2020-11-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Collect extends Model<Collect> {

    private static final long serialVersionUID = 1L;

    public final static int ACHIEVE_TYPE = 1;

    public final static int PATENT_TYPE = 2;

    public final static int DEMAND_TYPE = 3;


    /**
     * 收藏主键id
     */
    @TableId(value = "collect_id", type = IdType.AUTO)
    private Integer collectId;

    /**
     * 成果、专利、需求的id
     */
    private Integer foreignId;

    /**
     * 标识成果、专利、需求，
        1是成果
        2是专利
        3是需求
     */
    private Integer type;

    /**
     * 用户id
     */
    private Integer userId;


    @Override
    protected Serializable pkVal() {
        return this.collectId;
    }

}
